/*
 * @Author: 107w 8801453+lu-shangru@user.noreply.gitee.com
 * @Date: 2023-04-04 16:06:16
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-04-23 15:56:18
 * @Description:
 *
 * Copyright (c) 2023 by 107w, All Rights Reserved.
 */
import Cookies from 'js-cookie'

const TokenKey = 'access_token'
const UserInfo = 'user_info'

export function getToken() {
  return Cookies.get(TokenKey)
}
export function getUserInfoCookie() {
  return JSON.parse(Cookies.get(UserInfo) || '{}')
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
export function setUserInfoCookie(userInfo) {
  return Cookies.set(UserInfo, JSON.stringify(userInfo || {}))
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
